import request from '@/router/axios';

export const getWorkOrderList = (params) => {
  return request({
    url: '/api/mes-product/workorder/work-order-info',
    method: 'get',
    params: params
  });
};

//根据工单号查询发货信息
export const getShipListByWorkOrderNo = (current, size, params) => {
  return request({
    url: `/api/mes-warehouse/sheetheader/sheet-details/dilivery`,
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

//根据工单号查询领料信息
export const getPickingListByWorkOrderNo = (workOrderNo) => {
  return request({
    url: `/api/mes-warehouse/sheetheader/sheet-details/master?workOrderNo=${workOrderNo}`,
    method: 'get'
  });
};

//根据工单号查询产品信息进行分页
export const getProductByWorkOrderNoList = (current, size, params) => {
  return request({
    url: '/api/mes-product/product/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

//根据工单号查询smt上料进行分页
export const getSmtFeedListByWorkOrderNo = (current, size, params) => {
  return request({
    url: '/api/mes-product/feeding/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

//根据工单号查询过站信息进行分页
export const getStationInfoByWorkOrderNoList = (current, size, params) => {
  return request({
    url: '/api/mes-product/workorder-station/work-order-station-info',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getOverStationInfo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query/forward-trace-work-order-over-station-info',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

//根据工单号查询上料信息
export const getFeedListByWorkOrderNo = (workOrderId) => {
  return request({
    url: '/api/mes-product/workorder/feeding/list',
    method: 'get',
    params: {
      workOrderId
    }
  });
};

export const getDeliveryInfo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query/trace-delivery',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
